From cd623ad9d6281389b0a092520c777567fcf5464b Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Sat, 2 Mar 2024 14:23:46 +0000 Subject: feature: Add an 'All Lists' page --- .../lists/[listId]/components/DeleteListButton.tsx | 3 ++- .../app/dashboard/lists/[listId]/components/ListView.tsx | 12 +----------- packages/web/app/dashboard/lists/[listId]/page.tsx | 14 +++++++++++++- 3 files changed, 16 insertions(+), 13 deletions(-) (limited to 'packages/web/app/dashboard/lists/[listId]') diff --git a/packages/web/app/dashboard/lists/[listId]/components/DeleteListButton.tsx b/packages/web/app/dashboard/lists/[listId]/components/DeleteListButton.tsx index 8961b2d0..32a7facf 100644 --- a/packages/web/app/dashboard/lists/[listId]/components/DeleteListButton.tsx +++ b/packages/web/app/dashboard/lists/[listId]/components/DeleteListButton.tsx @@ -1,9 +1,10 @@ +"use client"; + import { Button } from "@/components/ui/button"; import { Dialog, DialogClose, DialogContent, - DialogDescription, DialogFooter, DialogHeader, DialogTitle, diff --git a/packages/web/app/dashboard/lists/[listId]/components/ListView.tsx b/packages/web/app/dashboard/lists/[listId]/components/ListView.tsx index c3d49b6a..6489e9f0 100644 --- a/packages/web/app/dashboard/lists/[listId]/components/ListView.tsx +++ b/packages/web/app/dashboard/lists/[listId]/components/ListView.tsx @@ -4,7 +4,6 @@ import BookmarksGrid from "@/app/dashboard/bookmarks/components/BookmarksGrid"; import { ZBookmark } from "@/lib/types/api/bookmarks"; import { ZBookmarkListWithBookmarks } from "@/lib/types/api/lists"; import { api } from "@/lib/trpc"; -import DeleteListButton from "./DeleteListButton"; export default function ListView({ bookmarks, @@ -21,15 +20,6 @@ export default function ListView({ ); return ( -
-
- - {data.icon} {data.name} - - -
-
- -
+ ); } diff --git a/packages/web/app/dashboard/lists/[listId]/page.tsx b/packages/web/app/dashboard/lists/[listId]/page.tsx index b8ca79c3..397a0f1e 100644 --- a/packages/web/app/dashboard/lists/[listId]/page.tsx +++ b/packages/web/app/dashboard/lists/[listId]/page.tsx @@ -3,6 +3,7 @@ import { getServerAuthSession } from "@/server/auth"; import { TRPCError } from "@trpc/server"; import { notFound, redirect } from "next/navigation"; import ListView from "./components/ListView"; +import DeleteListButton from "./components/DeleteListButton"; export default async function ListPage({ params, @@ -28,5 +29,16 @@ export default async function ListPage({ const bookmarks = await api.bookmarks.getBookmarks({ ids: list.bookmarks }); - return ; + return ( +
+
+ + {list.icon} {list.name} + + +
+
+ +
+ ); } -- cgit v1.2.3-70-g09d2